package com.design.pattern.behavioral.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * description
 *
 * @author RenQiQiang 2019/03/28 9:39
 */
public class Teacher implements Observer {
    private String teacherName;

    public Teacher(String teacherName) {
        this.teacherName = teacherName;
    }

    @Override
    public void update(Observable o, Object arg) {
        Course course = (Course)o;
        Question question = (Question)arg;
        System.out.println(teacherName + "老师的"+course.getCourseName()+"接收到"+question.getUserName()
        +"问题内容"+question.getQuestionContext());
    }
}
